declare const module: any;
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

async function bootstrap() {
  const app = await NestFactory.create(AppModule,{
    logger: ['log','error','warn','debug','verbose'],
  });

  const options = new DocumentBuilder()
  .setTitle('Blog Api')
  .setDescription('Blog Api')
  .setVersion('1.0')
  .addTag('user')
  .addTag('article')
  .addTag('classify')
  .addTag('label')
  .addTag('article-label')
  .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('api', app, document);

  app.enableCors();//开启跨域
  await app.listen(3000);

  if (module.hot) {
    module.hot.accept();
    module.hot.dispose(() => app.close());
  }
}
bootstrap();
